
package data;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import org.apache.struts.upload.FormFile;

/**
 *
 * @author Alejandro
 */
public class IniciarBitacorasAction extends org.apache.struts.action.Action {

    @Override
    public ActionForward execute(
            ActionMapping mapping,
            ActionForm form,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        IniciarBitacorasForm myForm = (IniciarBitacorasForm) form;

        FormFile myFile = myForm.getArchivo();
        String contentType = myFile.getContentType();
        String fileName = myFile.getFileName();
        int fileSize = myFile.getFileSize();
       // byte[] fileData = myFile.getFileData();
        String datos = ""+fileSize;
        request.getSession().setAttribute("datos", fileName);
        
        IniciarBitacorasGateway gw = new IniciarBitacorasGateway();
        gw.crearProfesor("1-0000-1111");
        gw.crearBitacora("1", "1-0000-1111");

        return mapping.findForward("success");
    }
}
